<?php

$router = include 'config.router.php';

$allConfig = array(
    'controllers' => array(
        'invokables' => array(
            'Base\Controller\Base' => 'Base\Controller\BaseController',
            'User\Controller\User' => 'User\Controller\UserController',
        ),
    ),

    'unlimit' => array(
        'Crontab' => array('check'),
    ),

    'translator' => array(
        'locale' => 'zh_CN',
        'translation_file_patterns' => array(
            array(
                'type'     => 'phparray',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.php',
            ),
        ),
    ),

    'session' => array(
        'config' => array(
            'class' => 'Zend\Session\Config\SessionConfig',
            'options' => array(
                'name' => 'reunion',
                'use_cookies' => true,
                'use_only_cookies' => true,
                'cookie_httponly' => true,
                'remember_me_seconds' => 2419200,/*浏览器端session过期时间*/
            ),
        ),
        'storage' => 'Zend\Session\Storage\SessionArrayStorage',
        'validators' => array(
            'Zend\Session\Validator\RemoteAddr',
            'Zend\Session\Validator\HttpUserAgent',
        ),
    ),

    'log' => array(
        'default' => array(
            'write_path' => __DIR__ . '/../data/log/runtime_'.date('Y-m-d').'.log',
            'write_mode' => 'append'
        )
    ),

    'view_manager' => array(
        'default_template_suffix'    => 'html',
        'display_not_found_reason'   => true,
        'display_exceptions'         => true,
        'doctype'                    => 'HTML5',
        'not_found_template'         => 'error/404',
        'exception_template'         => 'error/index',
        'template_map' => array(
            'layout/layout'          => __DIR__ . '/../view/layout/layout.phtml',
            'layout/nav'             => __DIR__ . '/../view/layout/nav.phtml',
            'layout/page'            => __DIR__ . '/../view/layout/paginator.phtml',
            'error/404'              => __DIR__ . '/../view/error/404.phtml',
            'error/index'            => __DIR__ . '/../view/error/index.phtml',
            'error/403'              => __DIR__ . '/../view/error/403.phtml',
            'user/login'             => __DIR__ . '/../view/user/user/login.phtml',
        ),
        'template_path_stack' => array(
            'user' => __DIR__ . '/../view',
        ),
    ),
);

$allConfig = array_merge($allConfig, $router);

return $allConfig;